<template>
<div>
<div class="user_page">
    <van-cell title="购物车" center is-link  @click="user_tiao('/buy_car')">
      <template #icon>
        <van-icon name="cart-o" size="30" badge="99+" />
      </template>
    </van-cell>
    <van-cell title="收藏" center is-link  @click="user_tiao('/collet')">
      <template #icon>
        <van-icon name="star-o" size="30" />
      </template>
    </van-cell>
    <van-cell title="足迹" center is-link  @click="user_tiao('/footprint')">
      <template #icon>
        <img class="zuji" src="@/assets/IMG/足迹.png" alt="" />
      </template>
    </van-cell>
    <van-cell title="红包卡券" center is-link  @click="user_tiao('/redpacket')">
      <template #icon>
        <van-icon name="cash-on-deliver" size="30" />
      </template>
    </van-cell>
    
  </div>
  <van-cell class="setting" title="设置" center is-link  @click="setting">
      <template #icon>
        <van-icon name="setting-o" size="30" />
      </template>
    </van-cell>
</div>
  
</template>
<script>
import { Toast } from "vant";
export default {
  name: "user_header",
  data() {
    return {
      is_deng: "",
    };
  },
  created() {
    if (localStorage.getItem("waimai") != undefined) {
      this.is_deng = 1;
    }
  },
  methods: {
    user_tiao(cc) {
      if (this.is_deng == 1) {
        this.$router.push(cc);
      } else {
        Toast("请先登录");
        this.$router.push("login");
      }
    },
    setting() {
      if (localStorage.getItem("waimai") != undefined) {
        this.$router.push("/setting");
      } else {
        Toast("请先登录")
        this.$router.push("/login");
      }
    },
  },
};
</script>

<style scoped>
.user_page {
  /* width: 95%; */
  margin: 10px auto;
  background-color: white;
  border-radius: 5px;
}

.class1 {
  width: 95%;
  margin: auto;
}

.zuji {
  width: 30px;
  height: 30px;
}

.van-cell--center {
  height: 60px;
  font-size: 18px;
}

.van-icon {
  margin-right: 12px;
}

img {
  margin-right: 12px;
}

.setting {
  margin-top: 10px;
}
</style>